
<form action="<?php echo $this->url(array("action"=>"add")) ?>"
	method="post" id="insert-form" enctype="multipart/form-data">

	<div class="form-left">
		<label for="PhotoLibID"><?php echo photo_add_lib?>: <span class="required">*</span></label>
	</div>
	<div class="form-right">
		<select name="PhotoLibID" id="PhotoLibID">
			<option value="null"><?php echo photo_add_no_select?></option>
                    <?php foreach ($this->LibPhoto as $lib){?>
                    <option value="<?php echo $lib["ID"]?>"><?php echo $lib["NAME"] ?></option>
                    <?php }?>
                    </select>
		
	</div>
	<div class="form-left">
		<label for="NamePhoto"><?php echo photo_add_image_name?>: <span class="required">*</span></label>
	</div>
	<div class="form-right">
		<input type="text" name="NamePhoto" class="txt" id="NamePhoto" />
		<span id="NamePhotoError" style="color: red;"></span>
	</div>

	<div class="form-left">
		<label for="PImg"><?php echo photo_add_image?>: <span class="required">*</span></label>
	</div>
	<div class="form-right">
		<input type="file" name="PImg" class="txt" id="PImg" />
                    <?php echo $this->errImg?>
	</div>
	<div class="form-left">
		<label for="textImg"><?php echo photo_add_image_link?>: <span
			class="required">*</span></label>
	</div>
	<div class="form-right">
		<input type="text" name="textImg" class="txt" id="textImg" />
	</div>
	<div class="form-left">
		<label for="stt"><?php echo photo_add_status?>: <span class="required">*</span></label>
	</div>
	<div class="form-right">
		<select name="stt" id="theme">
			<option value="1"><?php echo photo_add_show?></option>
			<option value="0"><?php echo photo_add_hide?></option>
		</select>
	</div>

	<div class="clear" style="text-align: right; width: 372px">
		<input type="submit" value="Save" style="float: right" />
	</div>
</form>

<script type="text/javascript">
$("#insert-form").submit(function(){
	var photo_name = $("#NamePhoto").val();
	if(photo_name.length == 0){
		$("#NamePhotoError").html("Tên hình không được trống");
		return false;
	}
	$("#NamePhotoError").html("");
	return true;
});
</script>